<template>
  <div class="container_login">
    <!-- 登录框 -->
    <div class="login_box">

      <!-- 登录logo -->
      <div class="login_logo">
        <img src="/static/02.jpg" alt="">
      </div>

      <!-- 输入框 -->
      <el-form :model="loginForm" :rules="login_rules" ref="loginFormRef">
        <!-- 用户名 -->
        <el-form-item placeholder="用户名" prop="username">
          <!-- 前置字体图标 -->
          <el-input v-model="loginForm.username">
            <i slot="prefix" class="iconfont icon-user"></i>
          </el-input>
        </el-form-item>

        <!-- 密码 -->
        <el-form-item placeholder="密码" prop="password">
          <!-- 前置字体图标 -->
          <el-input v-model="loginForm.password" :type="ispsd ? 'password' : 'text'">
            <!-- 点击小图标控制输入框的type -->
            <i slot="prefix" :class="['iconfont', ispsd ? 'icon-3702mima' : 'icon-showpassword']" @click="ispsd=!ispsd"></i>
          </el-input>
        </el-form-item>

        <!-- 按钮 -->
        <el-row>
          <el-button type="primary" @click="reset">重置</el-button>
          <!-- 点击按钮发送请求 -->
          <el-button type="success" @click="login">完成</el-button>
        </el-row>
      </el-form>

    </div>
  </div>
</template>

<script>
import mix from './login-mixins.js'
// 导入自己的mixins文件
export default {
  mixins: [mix]
}
</script>

<style lang="less" scoped>
// 登录页面容器
.container_login {
  background-color: lime;
  width: 100%;
  height: 100%;
  padding-top: 150px;

  // 登录框盒子
  .login_box {
    width: 500px;
    height: 300px;
    background-color: lime;
    border-radius: 20px;
    margin: 0 auto;
    position: relative;
    padding: 30px;

    // logo
    .login_logo {
      width: 140px;
      height: 140px;
      border-radius: 50%;
      padding: 10px;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      top: -60px;
      background-color: #fff;
      border: 1px solid #eeeeee;
      img {
        width: 100%;
        height: 100%;
        display: block;
        border-radius: 50%;
      }
    }

    // 表单
    .el-form {
      position: relative;
      bottom: -100px;
      .el-row {
        float: right;
      }
    }
  }
}
</style>
